ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods






STATEMENT:  Exit

Exit

The Exit statement allows you to exit from inside a block of code such as a conditional statement (Do ...Loop, For ... Next, For Each ... Next) or a procedure (Function, Sub) before it would normally be completed.

This allows you to exit from inside a Do Until ... Loop.

Code:
<% Exit Do %>

This allows you to exit from inside a Do While ... Loop.

Code:
<% Exit Do %>

This allows you to exit from inside a For ... Next.

Code:
<% Exit For %>

This allows you to exit from inside a For Each ... Next.

Code:
<% Exit For %>

This allows you to exit from inside a Function.

Code:
<% Exit Function %>

This allows you to exit from inside a Sub.

Code:
<% Exit Sub %>